package com.swsc.solarverse.controller.openapi;


import com.swsc.solarverse.common.Constant;
import com.swsc.solarverse.model.RestResp;
import com.swsc.solarverse.model.openapi.OpenApiForwardDeviceCombinerboxDataReqVO;
import com.swsc.solarverse.model.openapi.OpenApiForwardDeviceEnvironmentDataReqVO;
import com.swsc.solarverse.model.openapi.OpenApiForwardDeviceInverterDataReqVO;
import com.swsc.solarverse.service.openapi.OpenApiForwardDeviceDataService;

/**
 * @Author chencl
 * @Date 2025/3/3 14:01
 * @Version 1.0
 * @Description 第三方集控电气数据推送接口
 */
@org.springframework.web.bind.annotation.RestController
@org.springframework.web.bind.annotation.RequestMapping(value = Constant.OPEN_API_V1 + "/forward/device/data")
public class OpenApiForwardDeviceDataController {
    private final OpenApiForwardDeviceDataService openApiForwardDeviceDataService;

    public OpenApiForwardDeviceDataController(OpenApiForwardDeviceDataService openApiForwardDeviceDataService) {
        this.openApiForwardDeviceDataService = openApiForwardDeviceDataService;
    }

//    @io.swagger.annotations.ApiOperation("推送环境监测仪气象数据")
    @org.springframework.web.bind.annotation.PostMapping(value = "/post/environment")
    public RestResp postEnvironment(@org.springframework.web.bind.annotation.RequestBody OpenApiForwardDeviceEnvironmentDataReqVO reqVo) {
        openApiForwardDeviceDataService.postEnvironment(reqVo);
        return RestResp.success();
    }

//    @io.swagger.annotations.ApiOperation("推送逆变器数据")
    @org.springframework.web.bind.annotation.PostMapping(value = "/post/inverter")
    public RestResp postInverter(@org.springframework.web.bind.annotation.RequestBody OpenApiForwardDeviceInverterDataReqVO reqVo) {
        openApiForwardDeviceDataService.postInverter(reqVo);
        return RestResp.success();
    }

//    @io.swagger.annotations.ApiOperation("推送汇流箱数据")
    @org.springframework.web.bind.annotation.PostMapping(value = "/post/combinerbox")
    public RestResp postCombinerbox(@org.springframework.web.bind.annotation.RequestBody OpenApiForwardDeviceCombinerboxDataReqVO reqVo) {
        openApiForwardDeviceDataService.postCombinerbox(reqVo);
        return RestResp.success();
    }
}
